feat(scenarios): expand to 10 total scenarios + CLI external scenario files#75
Merged
Conversation
… files Add 5 new scenario fixtures aligned with v0.2 detection rules: - meter-value-gap: transaction with no MeterValues - invalid-stop-reason: StopTransaction with invalid 'PowerSurge' reason - unexpected-start: StartTransaction without BootNotification/Authorize - status-transition-violation: Available -> Finishing (illegal transition) - diagnostics-failure: DiagnosticsStatusNotification with DiagnosisFailed Update scenarios registry to export all 10 scenarios. Update tests to expect 10 scenarios and verify each triggers its expected failure code. Add CLI --file flag support: 'ocpp-debugkit scenario run --file <path>' loads and runs an external scenario JSON file through the analysis engine. Closes #60
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands from 5 to 10 total scenarios and adds CLI support for external scenario files.
New Scenarios
meter-value-gapMETER_VALUE_GAPinvalid-stop-reasonINVALID_STOP_REASONunexpected-startUNEXPECTED_STARTstatus-transition-violationSTATUS_TRANSITION_VIOLATIONdiagnostics-failureDIAGNOSTICS_FAILURECLI External Scenario Files
The external file must be a JSON object with
name,description,trace, andexpectedFailuresfields (same shape as built-in scenarios).Changes
packages/toolkit/src/scenarios/__scenarios__/index.tsregistry to export all 10 scenariosindex.test.ts— 36 tests (10 scenarios, engine integration for each, synthetic data policy)scenario.ts— sharedrunScenarioInternal(), newscenarioRunFileCommand()cli/index.ts—run [name]with--fileoptionVerification
pnpm test— 295/295 tests passpnpm build— cleanpnpm lint— cleanpnpm typecheck— cleanpnpm format:check— cleanCloses #60